$(document).ready(function(){
    //  When user clicks on tab, this code will be executed
    $(".tabs li").click(function() {
        //  First remove class "active" from currently active tab
        $(".tabs li").removeClass('active');
      
        //  Now add class "active" to the selected/clicked tab
        $(this).addClass("active");
         
        //  Hide all tab content
        $(".tab_content").hide();
      
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
 
        //  At the end, we add return false so that the click on the link is not executed
        return false;
    });
	
    //  When user clicks on tab, this code will be executed
    $(".tab_features li").click(function() {
        //  First remove class "active" from currently active tab
        $(".tab_features li").removeClass('active');
      
        //  Now add class "active" to the selected/clicked tab
        $(this).addClass("active");
         
        //  Hide all tab content
     
        $(".tab_contents").hide();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
 
        //  At the end, we add return false so that the click on the link is not executed
        return false;
    });
	 $(".tabs_up li").click(function() {
        //  First remove class "active" from currently active tab
        $(".tabs_up li").removeClass('active');
      
        //  Now add class "active" to the selected/clicked tab
        $(this).addClass("active");
         
        //  Hide all tab content
     
        $(".tab_contents_up").hide();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
 
        //  At the end, we add return false so that the click on the link is not executed
        return false;
    });
	 $(".tabs_reviews li").click(function() {
        //  First remove class "active" from currently active tab
        $(".tabs_reviews li").removeClass('active');
      
        //  Now add class "active" to the selected/clicked tab
        $(this).addClass("active");
         
        //  Hide all tab content
     
        $(".tab_contents_reviews").hide();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
 
        //  At the end, we add return false so that the click on the link is not executed
        return false;
    });
	
	 $(".tabs_roadTest li").click(function() {
        //  First remove class "active" from currently active tab
        $(".tabs_roadTest li").removeClass('active');
      
        //  Now add class "active" to the selected/clicked tab
        $(this).addClass("active");
         
        //  Hide all tab content
     
        $(".tab_contents_roadTest").hide();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
 
        //  At the end, we add return false so that the click on the link is not executed
        return false;
    });
	
	$("#bycategory1 a").click(function() {
       
          $("#bycategory1 a").addClass('select');
	      $("#bymake1 a").removeClass('select');
		  $("#bycategory1").addClass("active");
		  $("#bycategory1").removeClass('active');
	   
	      $(".tab_content2").hide();
          $(".tab_content1").show();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
           return false;
    });
	
	
	$("#bymake1 a").click(function() {
         $("#bymake1 a").addClass('select');
	     $("#bycategory1 a").removeClass('select');
		 $("#bymake1").removeClass('active');
	     $("#bymake1").addClass("active");
			
		 $(".tab_content1").hide();
         $(".tab_content2").show();
        //  Here we get the href value of the selected tab
        var selected_tab = $(this).find("a").attr("href");
 
        //  Show the selected tab content
        $(selected_tab).fadeIn();
           return false;
    });
	
	
	
	
	
	
	
	
	$("#explVechNewCar").click(function() {
       
        
	      $(".countUsedCar").hide();
          $(".countNewCar").show();
      
		
           return true;
    });
	
	
	$("#explVechUsedCar").click(function() {
        
		 $(".countNewCar").hide();
         $(".countUsedCar").show();
      
			

           return true;
    });
var version1 = 1,version2 = 1,version3 = 1,version4 = 1,version5 = 1,version6 = 1,version7 = 1,version8 = 1,version9 = 1,version10 = 1,version11 = 1,version12 = 1,version13 = 1,version14 = 1,version15 = 1,version16 = 1,version17 = 1,version18 = 1,version19 = 1,version20 = 1,version21 = 1,version22 = 1,version23 = 1,version24 = 1;version25 = 1,version26 = 1,version27 = 1;
$(".version1").click(function() {if(version1==0 ){$(".Car1").hide();version1++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car1").show();version1--;}else{$('.contentlist li span input:checkbox[name=ch1]').attr('checked',false);}exit();}return true;});
$(".version2").click(function() {if(version2==0 ){$(".Car2").hide();version2++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car2").show();version2--;}else{$('.contentlist li span input:checkbox[name=ch2]').attr('checked',false);}exit();}return true;});
$(".version3").click(function() {if(version3==0 ){$(".Car3").hide();version3++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car3").show();version3--;}else{$('.contentlist li span input:checkbox[name=ch3]').attr('checked',false);}exit();}return true;});
$(".version4").click(function() {if(version4==0 ){$(".Car4").hide();version4++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car4").show();version4--;}else{$('.contentlist li span input:checkbox[name=ch4]').attr('checked',false);}exit();}return true;});
$(".version5").click(function() {if(version5==0 ){$(".Car5").hide();version5++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car5").show();version5--;}else{$('.contentlist li span input:checkbox[name=ch5]').attr('checked',false);}exit();}return true;});
$(".version6").click(function() {if(version6==0 ){$(".Car6").hide();version6++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car6").show();version6--;}else{$('.contentlist li span input:checkbox[name=ch6]').attr('checked',false);}exit();}return true;});
$(".version7").click(function() {if(version7==0 ){$(".Car7").hide();version7++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car7").show();version7--;}else{$('.contentlist li span input:checkbox[name=ch7]').attr('checked',false);}exit();}return true;});
$(".version8").click(function() {if(version8==0 ){$(".Car8").hide();version8++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car8").show();version8--;}else{$('.contentlist li span input:checkbox[name=ch8]').attr('checked',false);}exit();}return true;});
$(".version9").click(function() {if(version9==0 ){$(".Car9").hide();version9++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car9").show();version9--;}else{$('.contentlist li span input:checkbox[name=ch9]').attr('checked',false);}exit();}return true;});
$(".version10").click(function() {if(version10==0 ){$(".Car10").hide();version10++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car10").show();version10--;}else{$('.contentlist li span input:checkbox[name=ch10]').attr('checked',false);}exit();}return true;});
$(".version11").click(function() {if(version11==0 ){$(".Car11").hide();version11++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car11").show();version11--;}else{$('.contentlist li span input:checkbox[name=ch11]').attr('checked',false);}exit();}return true;});
$(".version12").click(function() {if(version12==0 ){$(".Car12").hide();version12++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car12").show();version12--;}else{$('.contentlist li span input:checkbox[name=ch12]').attr('checked',false);}exit();}return true;});
$(".version13").click(function() {if(version13==0 ){$(".Car13").hide();version13++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car13").show();version13--;}else{$('.contentlist li span input:checkbox[name=ch13]').attr('checked',false);}exit();}return true;});
$(".version14").click(function() {if(version14==0 ){$(".Car14").hide();version14++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car14").show();version14--;}else{$('.contentlist li span input:checkbox[name=ch14]').attr('checked',false);}exit();}return true;});
$(".version15").click(function() {if(version15==0 ){$(".Car15").hide();version15++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car15").show();version15--;}else{$('.contentlist li span input:checkbox[name=ch15]').attr('checked',false);}exit();}return true;});
$(".version16").click(function() {if(version16==0 ){$(".Car16").hide();version16++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car16").show();version16--;}else{$('.contentlist li span input:checkbox[name=ch16]').attr('checked',false);}exit();}return true;});
$(".version17").click(function() {if(version17==0 ){$(".Car17").hide();version17++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car17").show();version17--;}else{$('.contentlist li span input:checkbox[name=ch17]').attr('checked',false);}exit();}return true;});
$(".version18").click(function() {if(version18==0 ){$(".Car18").hide();version18++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car18").show();version18--;}else{$('.contentlist li span input:checkbox[name=ch18]').attr('checked',false);}exit();}return true;});
$(".version19").click(function() {if(version19==0 ){$(".Car19").hide();version19++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car19").show();version19--;}else{$('.contentlist li span input:checkbox[name=ch19]').attr('checked',false);}exit();}return true;});
$(".version20").click(function() {if(version20==0 ){$(".Car20").hide();version20++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car20").show();version20--;}else{$('.contentlist li span input:checkbox[name=ch20]').attr('checked',false);}exit();}return true;});
$(".version21").click(function() {if(version21==0 ){$(".Car21").hide();version21++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car21").show();version21--;}else{$('.contentlist li span input:checkbox[name=ch21]').attr('checked',false);}exit();}return true;});
$(".version22").click(function() {if(version22==0 ){$(".Car22").hide();version22++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car22").show();version22--;}else{$('.contentlist li span input:checkbox[name=ch22]').attr('checked',false);}exit();}return true;});
$(".version23").click(function() {if(version23==0 ){$(".Car23").hide();version23++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car23").show();version23--;}else{$('.contentlist li span input:checkbox[name=ch23]').attr('checked',false);}exit();}return true;});
$(".version24").click(function() {if(version24==0 ){$(".Car24").hide();version24++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car24").show();version24--;}else{$('.contentlist li span input:checkbox[name=ch24]').attr('checked',false);}exit();}return true;});
$(".version25").click(function() {if(version25==0 ){$(".Car25").hide();version25++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car25").show();version25--;}else{$('.contentlist li span input:checkbox[name=ch25]').attr('checked',false);}exit();}return true;});
$(".version26").click(function() {if(version26==0 ){$(".Car26").hide();version26++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car26").show();version26--;}else{$('.contentlist li span input:checkbox[name=ch26]').attr('checked',false);}exit();}return true;});
$(".version27").click(function() {if(version27==0 ){$(".Car27").hide();version27++;count_checked();exit();}else{var a=count_checked();if(a==1){
$(".Car27").show();version27--;}else{$('.contentlist li span input:checkbox[name=ch27]').attr('checked',false);}exit();}return true;});

$(".remove_Car1").click(function() {
		$(".Car1").hide();
        $('.contentlist li span input:checkbox[name=ch1]').attr('checked',false);
		 return true;
    });
	$(".remove_Car2").click(function() {
        $(".Car2").hide();
	    $('.contentlist li span input:checkbox[name=ch2]').attr('checked',false);
	     return true;
    });

	$(".remove_Car3").click(function() {
        $(".Car3").hide();
		$('.contentlist li span input:checkbox[name=ch3]').attr('checked',false);
	     return true;
    });
	$(".remove_Car4").click(function() {
        $(".Car4").hide();
		$('.contentlist li span input:checkbox[name=ch4]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car5").click(function() {
        $(".Car5").hide();
		$('.contentlist li span input:checkbox[name=ch5]').attr('checked',false);
	     return true;
    });
	$(".remove_Car6").click(function() {
        $(".Car6").hide();
		$('.contentlist li span input:checkbox[name=ch6]').attr('checked',false);
	     return true;
    });
	$(".remove_Car7").click(function() {
        $(".Car7").hide();
		$('.contentlist li span input:checkbox[name=ch7]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car8").click(function() {
        $(".Car8").hide();
		$('.contentlist li span input:checkbox[name=ch8]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car9").click(function() {
        $(".Car9").hide();
		$('.contentlist li span input:checkbox[name=ch9]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car10").click(function() {
        $(".Car10").hide();
		$('.contentlist li span input:checkbox[name=ch10]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car11").click(function() {
        $(".Car11").hide();
		$('.contentlist li span input:checkbox[name=ch11]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car12").click(function() {
        $(".Car12").hide();
		$('.contentlist li span input:checkbox[name=ch12]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car13").click(function() {
        $(".Car13").hide();
		$('.contentlist li span input:checkbox[name=ch13]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car14").click(function() {
        $(".Car14").hide();
		$('.contentlist li span input:checkbox[name=ch14]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car15").click(function() {
        $(".Car15").hide();
		$('.contentlist li span input:checkbox[name=ch15]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car16").click(function() {
        $(".Car16").hide();
		$('.contentlist li span input:checkbox[name=ch16]').attr('checked',false);
	     return true;
    });
	$(".remove_Car17").click(function() {
        $(".Car17").hide();
		$('.contentlist li span input:checkbox[name=ch17]').attr('checked',false);
	     return true;
    });
	$(".remove_Car18").click(function() {
        $(".Car18").hide();
		$('.contentlist li span input:checkbox[name=ch18]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car19").click(function() {
        $(".Car19").hide();
		$('.contentlist li span input:checkbox[name=ch19]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car20").click(function() {
        $(".Car20").hide();
		$('.contentlist li span input:checkbox[name=ch20]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car21").click(function() {
        $(".Car21").hide();
		$('.contentlist li span input:checkbox[name=ch21]').attr('checked',false);
	     return true;
    });
	
	$(".remove_Car22").click(function() {
        $(".Car22").hide();
		$('.contentlist li span input:checkbox[name=ch22]').attr('checked',false);
	     return true;
    });
	$(".remove_Car23").click(function() {
        $(".Car23").hide();
		$('.contentlist li span input:checkbox[name=ch23]').attr('checked',false);
	     return true;
    });
	$(".remove_Car24").click(function() {
        $(".Car24").hide();
		$('.contentlist li span input:checkbox[name=ch24]').attr('checked',false);
	     return true;
    });
	$(".remove_Car25").click(function() {
        $(".Car25").hide();
		$('.contentlist li span input:checkbox[name=ch25]').attr('checked',false);
	     return true;
    });
	$(".remove_Car26").click(function() {
        $(".Car26").hide();
		$('.contentlist li span input:checkbox[name=ch26]').attr('checked',false);
	     return true;
    });
	$(".remove_Car27").click(function() {
        $(".Car27").hide();
		$('.contentlist li span input:checkbox[name=ch27]').attr('checked',false);
	     return true;
    });
	
	
function count_checked(){var k = 0,token=1;jQuery(".contentlist li span").find("input:checkbox:checked").each(function(i){k++});if(k==0){$(".show_detail").hide();	}if(k>0){$(".show_detail").show();	}if(k>4){alert("You can select only upto four vehicles");token=0;}return token;}
function go_search(){var qs = "";var j = 0;jQuery(".contentlist li span").find("input:checkbox:checked").each(function(i){if( qs == "" )qs += "car" + (i+1) + "=" +  jQuery(this).val();else qs += "&car" + (i+1) + "=" +  jQuery(this).val();j++});if( qs != "" ){if(j >= 1)location.href = "http://www.gowheels.co.in/new/search-resultlist.shtml?"	+ qs;else alert("Please select minimum one cars for result");}else{alert("Please select minimum one cars for result");}}	
	
	// script options  from http://bxslider.com/options
	 $('#mygallery1').bxSlider({
		displaySlideQty: 4,
		moveSlideQty: 1,
		speed:1000,
		prevText: '<div class="arrow"> <img src="http://www.gowheels.co.in/resources/img/arr1.png" /></div>',
nextText: '<div class="arrow2">	<img src="http://www.gowheels.co.in/resources/img/arr2.png"/></div>',

		
  });
  
  
});
//search result list script
function showtabcontent_gowheel(objClicked){
		var objCriHead =  jQuery(objClicked)
		var objCriteria = objCriHead.next();
		
		if( objCriteria.hasClass("tabcontent_show_gowheel") ){
			objCriteria.removeClass("tabcontent_show_gowheel").addClass("gowheel_tabcontent_show").show(1000);
			objCriHead.find("span").removeClass("right-arrow").addClass("down-arrow2");
		}else{
			objCriteria.removeClass("gowheel_tabcontent_show").addClass("tabcontent_show_gowheel").hide(1000);
			objCriHead.find("span").removeClass("down-arrow2").addClass("right-arrow");
		}	
	}
	function expandModel(obj){
		var objModel =  jQuery(obj);
		var modelId = objModel.attr("id");
		
		var objHidden = objModel.find("#modHide");
		var objShow = objModel.find("#modShow");
		var objModelIcon = objModel.find("#modShowIcon");
		
		if( objHidden.hasClass("hide") ){
			objHidden.removeClass("hide").addClass("show");
			objShow.removeClass("show").addClass("hide");
			objModelIcon.removeClass("right-arrow").addClass("down-arrow2");
			
			 jQuery(".cls_" + modelId).show();			
			 jQuery(".cls_" + modelId + ":last").addClass("version-bot");
			 jQuery("#mod_" + modelId).addClass("model-row-bot");
		}else{
			objHidden.removeClass("show").addClass("hide");
			objShow.addClass("hide").addClass("show");
			objModelIcon.removeClass("down-arrow2").addClass("right-arrow");
			
			 jQuery(".cls_" + modelId).hide();
			 jQuery(".cls_" + modelId + ":last").removeClass("version-bot");
			 jQuery("#mod_" + modelId).removeClass("model-row-bot");
		}		
	}
	
	


	function compareSelected(){
		var qs = ""
		var j = 0;
		 jQuery(".contentlist li span").find("input:checkbox:checked").each(function(i){
			if( qs == "" )
				qs += "car" + (i+1) + "=" +  jQuery(this).val();
			else
				qs += "&car" + (i+1) + "=" +  jQuery(this).val();
			
			j++
		});
		
		if( qs != "" ){
			if(j >= 2)
				location.href = "http://www.gowheels.co.in/new/search-resultlist.shtml?"	+ qs;
			else
				alert("Please select minimum two cars to compare");
		}
		else{
			alert("Please choose at least two cars to compare.\nClick on the Matching Versions link to see the cars available for comparison.");
		}
	}	

//text box javascript
/* fixed footer */
(function () {
new CNB.Fixated('cnet-brand', {
edge: 'bottom',
bottomEl: 'footer'
});

CNB.loadCbsSitesLink('cnet-sites-link', '75');
})();


  // JavaScript Document